3.1.1 \(\int \frac {\sin ^4(x)}{a+b \sin (x)+c \sin ^2(x)} \, dx\) [1]

3.1.1.1 Optimal result
3.1.1.2 Mathematica [C] (verified)
3.1.1.3 Rubi [A] (verified)
3.1.1.4 Maple [A] (verified)
3.1.1.5 Fricas [B] (verification not implemented)
3.1.1.6 Sympy [F(-1)]
3.1.1.7 Maxima [F]
3.1.1.8 Giac [F(-1)]
3.1.1.9 Mupad [B] (verification not implemented)

3.1.1.1 Optimal result

Integrand size = 19, antiderivative size = 323 \[ \int \frac {\sin ^4(x)}{a+b \sin (x)+c \sin ^2(x)} \, dx=\frac {x}{2 c}+\frac {\left (b^2-a c\right ) x}{c^3}-\frac {\sqrt {2} \left (b^3-2 a b c-\frac {b^4-4 a b^2 c+2 a^2 c^2}{\sqrt {b^2-4 a c}}\right ) \arctan \left (\frac {2 c+\left (b-\sqrt {b^2-4 a c}\right ) \tan \left (\frac {x}{2}\right )}{\sqrt {2} \sqrt {b^2-2 c (a+c)-b \sqrt {b^2-4 a c}}}\right )}{c^3 \sqrt {b^2-2 c (a+c)-b \sqrt {b^2-4 a c}}}-\frac {\sqrt {2} \left (b^3-2 a b c+\frac {b^4-4 a b^2 c+2 a^2 c^2}{\sqrt {b^2-4 a c}}\right ) \arctan \left (\frac {2 c+\left (b+\sqrt {b^2-4 a c}\right ) \tan \left (\frac {x}{2}\right )}{\sqrt {2} \sqrt {b^2-2 c (a+c)+b \sqrt {b^2-4 a c}}}\right )}{c^3 \sqrt {b^2-2 c (a+c)+b \sqrt {b^2-4 a c}}}+\frac {b \cos (x)}{c^2}-\frac {\cos (x) \sin (x)}{2 c} \]

output
1/2*x/c+(-a*c+b^2)*x/c^3+b*cos(x)/c^2-1/2*cos(x)*sin(x)/c-arctan(1/2*(2*c+ 
(b-(-4*a*c+b^2)^(1/2))*tan(1/2*x))*2^(1/2)/(b^2-2*c*(a+c)-b*(-4*a*c+b^2)^( 
1/2))^(1/2))*2^(1/2)*(b^3-2*a*b*c+(-2*a^2*c^2+4*a*b^2*c-b^4)/(-4*a*c+b^2)^ 
(1/2))/c^3/(b^2-2*c*(a+c)-b*(-4*a*c+b^2)^(1/2))^(1/2)-arctan(1/2*(2*c+(b+( 
-4*a*c+b^2)^(1/2))*tan(1/2*x))*2^(1/2)/(b^2-2*c*(a+c)+b*(-4*a*c+b^2)^(1/2) 
)^(1/2))*2^(1/2)*(b^3-2*a*b*c+(2*a^2*c^2-4*a*b^2*c+b^4)/(-4*a*c+b^2)^(1/2) 
)/c^3/(b^2-2*c*(a+c)+b*(-4*a*c+b^2)^(1/2))^(1/2)
 
3.1.1.2 Mathematica [C] (verified)

Result contains complex when optimal does not.

Time = 1.22 (sec) , antiderivative size = 410, normalized size of antiderivative = 1.27 \[ \int \frac {\sin ^4(x)}{a+b \sin (x)+c \sin ^2(x)} \, dx=\frac {4 b^2 x+2 c (-2 a+c) x-\frac {4 \left (i b^4-4 i a b^2 c+2 i a^2 c^2+b^3 \sqrt {-b^2+4 a c}-2 a b c \sqrt {-b^2+4 a c}\right ) \arctan \left (\frac {2 c+\left (b-i \sqrt {-b^2+4 a c}\right ) \tan \left (\frac {x}{2}\right )}{\sqrt {2} \sqrt {b^2-2 c (a+c)-i b \sqrt {-b^2+4 a c}}}\right )}{\sqrt {-\frac {b^2}{2}+2 a c} \sqrt {b^2-2 c (a+c)-i b \sqrt {-b^2+4 a c}}}-\frac {4 \left (-i b^4+4 i a b^2 c-2 i a^2 c^2+b^3 \sqrt {-b^2+4 a c}-2 a b c \sqrt {-b^2+4 a c}\right ) \arctan \left (\frac {2 c+\left (b+i \sqrt {-b^2+4 a c}\right ) \tan \left (\frac {x}{2}\right )}{\sqrt {2} \sqrt {b^2-2 c (a+c)+i b \sqrt {-b^2+4 a c}}}\right )}{\sqrt {-\frac {b^2}{2}+2 a c} \sqrt {b^2-2 c (a+c)+i b \sqrt {-b^2+4 a c}}}+4 b c \cos (x)-c^2 \sin (2 x)}{4 c^3} \]

input
Integrate[Sin[x]^4/(a + b*Sin[x] + c*Sin[x]^2),x]
 
output
(4*b^2*x + 2*c*(-2*a + c)*x - (4*(I*b^4 - (4*I)*a*b^2*c + (2*I)*a^2*c^2 + 
b^3*Sqrt[-b^2 + 4*a*c] - 2*a*b*c*Sqrt[-b^2 + 4*a*c])*ArcTan[(2*c + (b - I* 
Sqrt[-b^2 + 4*a*c])*Tan[x/2])/(Sqrt[2]*Sqrt[b^2 - 2*c*(a + c) - I*b*Sqrt[- 
b^2 + 4*a*c]])])/(Sqrt[-1/2*b^2 + 2*a*c]*Sqrt[b^2 - 2*c*(a + c) - I*b*Sqrt 
[-b^2 + 4*a*c]]) - (4*((-I)*b^4 + (4*I)*a*b^2*c - (2*I)*a^2*c^2 + b^3*Sqrt 
[-b^2 + 4*a*c] - 2*a*b*c*Sqrt[-b^2 + 4*a*c])*ArcTan[(2*c + (b + I*Sqrt[-b^ 
2 + 4*a*c])*Tan[x/2])/(Sqrt[2]*Sqrt[b^2 - 2*c*(a + c) + I*b*Sqrt[-b^2 + 4* 
a*c]])])/(Sqrt[-1/2*b^2 + 2*a*c]*Sqrt[b^2 - 2*c*(a + c) + I*b*Sqrt[-b^2 + 
4*a*c]]) + 4*b*c*Cos[x] - c^2*Sin[2*x])/(4*c^3)
 
3.1.1.3 Rubi [A] (verified)

Time = 2.24 (sec) , antiderivative size = 323, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.158, Rules used = {3042, 3737, 2009}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \frac {\sin ^4(x)}{a+b \sin (x)+c \sin ^2(x)} \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {\sin (x)^4}{a+b \sin (x)+c \sin (x)^2}dx\)

\(\Big \downarrow \) 3737

\(\displaystyle \int \left (\frac {b^2-a c}{c^3}+\frac {-a b^2 \left (1-\frac {a c}{b^2}\right )-\left (b^3 \sin (x) \left (1-\frac {2 a c}{b^2}\right )\right )}{c^3 \left (a+b \sin (x)+c \sin ^2(x)\right )}-\frac {b \sin (x)}{c^2}+\frac {\sin ^2(x)}{c}\right )dx\)

\(\Big \downarrow \) 2009

\(\displaystyle -\frac {\sqrt {2} \left (-\frac {2 a^2 c^2-4 a b^2 c+b^4}{\sqrt {b^2-4 a c}}-2 a b c+b^3\right ) \arctan \left (\frac {\tan \left (\frac {x}{2}\right ) \left (b-\sqrt {b^2-4 a c}\right )+2 c}{\sqrt {2} \sqrt {-b \sqrt {b^2-4 a c}-2 c (a+c)+b^2}}\right )}{c^3 \sqrt {-b \sqrt {b^2-4 a c}-2 c (a+c)+b^2}}-\frac {\sqrt {2} \left (\frac {2 a^2 c^2-4 a b^2 c+b^4}{\sqrt {b^2-4 a c}}-2 a b c+b^3\right ) \arctan \left (\frac {\tan \left (\frac {x}{2}\right ) \left (\sqrt {b^2-4 a c}+b\right )+2 c}{\sqrt {2} \sqrt {b \sqrt {b^2-4 a c}-2 c (a+c)+b^2}}\right )}{c^3 \sqrt {b \sqrt {b^2-4 a c}-2 c (a+c)+b^2}}+\frac {x \left (b^2-a c\right )}{c^3}+\frac {b \cos (x)}{c^2}+\frac {x}{2 c}-\frac {\sin (x) \cos (x)}{2 c}\)

input
Int[Sin[x]^4/(a + b*Sin[x] + c*Sin[x]^2),x]
 
output
x/(2*c) + ((b^2 - a*c)*x)/c^3 - (Sqrt[2]*(b^3 - 2*a*b*c - (b^4 - 4*a*b^2*c 
 + 2*a^2*c^2)/Sqrt[b^2 - 4*a*c])*ArcTan[(2*c + (b - Sqrt[b^2 - 4*a*c])*Tan 
[x/2])/(Sqrt[2]*Sqrt[b^2 - 2*c*(a + c) - b*Sqrt[b^2 - 4*a*c]])])/(c^3*Sqrt 
[b^2 - 2*c*(a + c) - b*Sqrt[b^2 - 4*a*c]]) - (Sqrt[2]*(b^3 - 2*a*b*c + (b^ 
4 - 4*a*b^2*c + 2*a^2*c^2)/Sqrt[b^2 - 4*a*c])*ArcTan[(2*c + (b + Sqrt[b^2 
- 4*a*c])*Tan[x/2])/(Sqrt[2]*Sqrt[b^2 - 2*c*(a + c) + b*Sqrt[b^2 - 4*a*c]] 
)])/(c^3*Sqrt[b^2 - 2*c*(a + c) + b*Sqrt[b^2 - 4*a*c]]) + (b*Cos[x])/c^2 - 
 (Cos[x]*Sin[x])/(2*c)
 

3.1.1.3.1 Defintions of rubi rules used

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 3737
Int[sin[(d_.) + (e_.)*(x_)]^(m_.)*((a_.) + (b_.)*sin[(d_.) + (e_.)*(x_)]^(n 
_.) + (c_.)*sin[(d_.) + (e_.)*(x_)]^(n2_.))^(p_), x_Symbol] :> Int[ExpandTr 
ig[sin[d + e*x]^m*(a + b*sin[d + e*x]^n + c*sin[d + e*x]^(2*n))^p, x], x] / 
; FreeQ[{a, b, c, d, e}, x] && EqQ[n2, 2*n] && NeQ[b^2 - 4*a*c, 0] && Integ 
ersQ[m, n, p]
 
3.1.1.4 Maple [A] (verified)

Time = 3.04 (sec) , antiderivative size = 372, normalized size of antiderivative = 1.15

method result size
default \(\frac {2 a \left (-\frac {2 \left (-3 \sqrt {-4 a c +b^{2}}\, a b c +\sqrt {-4 a c +b^{2}}\, b^{3}+4 a^{2} c^{2}-5 a \,b^{2} c +b^{4}\right ) \arctan \left (\frac {-2 a \tan \left (\frac {x}{2}\right )+\sqrt {-4 a c +b^{2}}-b}{\sqrt {4 a c -2 b^{2}+2 b \sqrt {-4 a c +b^{2}}+4 a^{2}}}\right )}{\left (8 a c -2 b^{2}\right ) \sqrt {4 a c -2 b^{2}+2 b \sqrt {-4 a c +b^{2}}+4 a^{2}}}+\frac {2 \left (3 \sqrt {-4 a c +b^{2}}\, a b c -\sqrt {-4 a c +b^{2}}\, b^{3}+4 a^{2} c^{2}-5 a \,b^{2} c +b^{4}\right ) \arctan \left (\frac {2 a \tan \left (\frac {x}{2}\right )+b +\sqrt {-4 a c +b^{2}}}{\sqrt {4 a c -2 b^{2}-2 b \sqrt {-4 a c +b^{2}}+4 a^{2}}}\right )}{\left (8 a c -2 b^{2}\right ) \sqrt {4 a c -2 b^{2}-2 b \sqrt {-4 a c +b^{2}}+4 a^{2}}}\right )}{c^{3}}-\frac {2 \left (\frac {-\frac {c^{2} \left (\tan ^{3}\left (\frac {x}{2}\right )\right )}{2}-b c \left (\tan ^{2}\left (\frac {x}{2}\right )\right )+\frac {c^{2} \tan \left (\frac {x}{2}\right )}{2}-b c}{\left (1+\tan ^{2}\left (\frac {x}{2}\right )\right )^{2}}+\frac {\left (2 a c -2 b^{2}-c^{2}\right ) \arctan \left (\tan \left (\frac {x}{2}\right )\right )}{2}\right )}{c^{3}}\) \(372\)
risch \(\text {Expression too large to display}\) \(3919\)

input
int(sin(x)^4/(a+b*sin(x)+c*sin(x)^2),x,method=_RETURNVERBOSE)
 
output
2/c^3*a*(-2*(-3*(-4*a*c+b^2)^(1/2)*a*b*c+(-4*a*c+b^2)^(1/2)*b^3+4*a^2*c^2- 
5*a*b^2*c+b^4)/(8*a*c-2*b^2)/(4*a*c-2*b^2+2*b*(-4*a*c+b^2)^(1/2)+4*a^2)^(1 
/2)*arctan((-2*a*tan(1/2*x)+(-4*a*c+b^2)^(1/2)-b)/(4*a*c-2*b^2+2*b*(-4*a*c 
+b^2)^(1/2)+4*a^2)^(1/2))+2*(3*(-4*a*c+b^2)^(1/2)*a*b*c-(-4*a*c+b^2)^(1/2) 
*b^3+4*a^2*c^2-5*a*b^2*c+b^4)/(8*a*c-2*b^2)/(4*a*c-2*b^2-2*b*(-4*a*c+b^2)^ 
(1/2)+4*a^2)^(1/2)*arctan((2*a*tan(1/2*x)+b+(-4*a*c+b^2)^(1/2))/(4*a*c-2*b 
^2-2*b*(-4*a*c+b^2)^(1/2)+4*a^2)^(1/2)))-2/c^3*((-1/2*c^2*tan(1/2*x)^3-b*c 
*tan(1/2*x)^2+1/2*c^2*tan(1/2*x)-b*c)/(1+tan(1/2*x)^2)^2+1/2*(2*a*c-2*b^2- 
c^2)*arctan(tan(1/2*x)))
 
3.1.1.5 Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 8169 vs. \(2 (285) = 570\).

Time = 4.77 (sec) , antiderivative size = 8169, normalized size of antiderivative = 25.29 \[ \int \frac {\sin ^4(x)}{a+b \sin (x)+c \sin ^2(x)} \, dx=\text {Too large to display} \]

input
integrate(sin(x)^4/(a+b*sin(x)+c*sin(x)^2),x, algorithm="fricas")
 
output
Too large to include
 
3.1.1.6 Sympy [F(-1)]

Timed out. \[ \int \frac {\sin ^4(x)}{a+b \sin (x)+c \sin ^2(x)} \, dx=\text {Timed out} \]

input
integrate(sin(x)**4/(a+b*sin(x)+c*sin(x)**2),x)
 
output
Timed out
 
3.1.1.7 Maxima [F]

\[ \int \frac {\sin ^4(x)}{a+b \sin (x)+c \sin ^2(x)} \, dx=\int { \frac {\sin \left (x\right )^{4}}{c \sin \left (x\right )^{2} + b \sin \left (x\right ) + a} \,d x } \]

input
integrate(sin(x)^4/(a+b*sin(x)+c*sin(x)^2),x, algorithm="maxima")
 
output
1/4*(4*c^3*integrate(-2*(2*(b^4 - 2*a*b^2*c)*cos(3*x)^2 + 4*(2*a^2*b^2 - a 
^2*c^2 - (2*a^3 - a*b^2)*c)*cos(2*x)^2 + 2*(b^4 - 2*a*b^2*c)*cos(x)^2 + 2* 
(b^4 - 2*a*b^2*c)*sin(3*x)^2 + 2*(4*a*b^3 - 2*a*b*c^2 - (6*a^2*b - b^3)*c) 
*cos(x)*sin(2*x) + 4*(2*a^2*b^2 - a^2*c^2 - (2*a^3 - a*b^2)*c)*sin(2*x)^2 
+ 2*(b^4 - 2*a*b^2*c)*sin(x)^2 - (2*(a*b^2*c - a^2*c^2)*cos(2*x) + (b^3*c 
- 2*a*b*c^2)*sin(3*x) - (b^3*c - 2*a*b*c^2)*sin(x))*cos(4*x) - 2*(2*(b^4 - 
 2*a*b^2*c)*cos(x) + (4*a*b^3 - 2*a*b*c^2 - (6*a^2*b - b^3)*c)*sin(2*x))*c 
os(3*x) - 2*(a*b^2*c - a^2*c^2 + (4*a*b^3 - 2*a*b*c^2 - (6*a^2*b - b^3)*c) 
*sin(x))*cos(2*x) + ((b^3*c - 2*a*b*c^2)*cos(3*x) - (b^3*c - 2*a*b*c^2)*co 
s(x) - 2*(a*b^2*c - a^2*c^2)*sin(2*x))*sin(4*x) - (b^3*c - 2*a*b*c^2 - 2*( 
4*a*b^3 - 2*a*b*c^2 - (6*a^2*b - b^3)*c)*cos(2*x) + 4*(b^4 - 2*a*b^2*c)*si 
n(x))*sin(3*x) + (b^3*c - 2*a*b*c^2)*sin(x))/(c^5*cos(4*x)^2 + 4*b^2*c^3*c 
os(3*x)^2 + 4*b^2*c^3*cos(x)^2 + c^5*sin(4*x)^2 + 4*b^2*c^3*sin(3*x)^2 + 4 
*b^2*c^3*sin(x)^2 + 4*b*c^4*sin(x) + c^5 + 4*(4*a^2*c^3 + 4*a*c^4 + c^5)*c 
os(2*x)^2 + 8*(2*a*b*c^3 + b*c^4)*cos(x)*sin(2*x) + 4*(4*a^2*c^3 + 4*a*c^4 
 + c^5)*sin(2*x)^2 - 2*(2*b*c^4*sin(3*x) - 2*b*c^4*sin(x) - c^5 + 2*(2*a*c 
^4 + c^5)*cos(2*x))*cos(4*x) - 8*(b^2*c^3*cos(x) + (2*a*b*c^3 + b*c^4)*sin 
(2*x))*cos(3*x) - 4*(2*a*c^4 + c^5 + 2*(2*a*b*c^3 + b*c^4)*sin(x))*cos(2*x 
) + 4*(b*c^4*cos(3*x) - b*c^4*cos(x) - (2*a*c^4 + c^5)*sin(2*x))*sin(4*x) 
- 4*(2*b^2*c^3*sin(x) + b*c^4 - 2*(2*a*b*c^3 + b*c^4)*cos(2*x))*sin(3*x...
 
3.1.1.8 Giac [F(-1)]

Timed out. \[ \int \frac {\sin ^4(x)}{a+b \sin (x)+c \sin ^2(x)} \, dx=\text {Timed out} \]

input
integrate(sin(x)^4/(a+b*sin(x)+c*sin(x)^2),x, algorithm="giac")
 
output
Timed out
 
3.1.1.9 Mupad [B] (verification not implemented)

Time = 25.96 (sec) , antiderivative size = 39682, normalized size of antiderivative = 122.85 \[ \int \frac {\sin ^4(x)}{a+b \sin (x)+c \sin ^2(x)} \, dx=\text {Too large to display} \]

input
int(sin(x)^4/(a + c*sin(x)^2 + b*sin(x)),x)
 
output
((2*b)/c^2 - tan(x/2)/c + tan(x/2)^3/c + (2*b*tan(x/2)^2)/c^2)/(2*tan(x/2) 
^2 + tan(x/2)^4 + 1) - atan(((((2048*(44*a^5*c^9 - 16*a^4*c^10 - 4*a^6*c^8 
 - 64*a^7*c^7 + 12*a^8*c^6 + 4*a*b^6*c^7 + 15*a*b^8*c^5 + 14*a*b^10*c^3 - 
28*a^2*b^4*c^8 - 119*a^2*b^6*c^6 - 128*a^2*b^8*c^4 - 8*a^2*b^10*c^2 + 52*a 
^3*b^2*c^9 + 290*a^3*b^4*c^7 + 397*a^3*b^6*c^5 + 62*a^3*b^8*c^3 - 227*a^4* 
b^2*c^8 - 491*a^4*b^4*c^6 - 148*a^4*b^6*c^4 + 8*a^4*b^8*c^2 + 221*a^5*b^2* 
c^7 + 102*a^5*b^4*c^5 - 60*a^5*b^6*c^3 + 68*a^6*b^2*c^6 + 136*a^6*b^4*c^4 
- 100*a^7*b^2*c^5))/c^8 - (-(a^2*b^8 - b^10 + 8*a^5*c^5 + 8*a^6*c^4 - b^7* 
(-(4*a*c - b^2)^3)^(1/2) - 10*a^3*b^6*c + a^2*b^5*(-(4*a*c - b^2)^3)^(1/2) 
 - 52*a^2*b^6*c^2 + 96*a^3*b^4*c^3 - 66*a^4*b^2*c^4 + 33*a^4*b^4*c^2 - 38* 
a^5*b^2*c^3 + 12*a*b^8*c + 4*a^3*b*c^3*(-(4*a*c - b^2)^3)^(1/2) - 4*a^3*b^ 
3*c*(-(4*a*c - b^2)^3)^(1/2) + 3*a^4*b*c^2*(-(4*a*c - b^2)^3)^(1/2) - 10*a 
^2*b^3*c^2*(-(4*a*c - b^2)^3)^(1/2) + 6*a*b^5*c*(-(4*a*c - b^2)^3)^(1/2))/ 
(2*(16*a^2*c^10 + 32*a^3*c^9 + 16*a^4*c^8 + b^4*c^8 - b^6*c^6 - 8*a*b^2*c^ 
9 + 10*a*b^4*c^7 - 32*a^2*b^2*c^8 + a^2*b^4*c^6 - 8*a^3*b^2*c^7)))^(1/2)*( 
(2048*(4*a*b^3*c^11 + 13*a*b^5*c^9 + 4*a*b^7*c^7 - 12*a*b^9*c^5 - 16*a^2*b 
*c^12 + 44*a^3*b*c^11 + 4*a^4*b*c^10 + 80*a^5*b*c^9 + 12*a^6*b*c^8 - 63*a^ 
2*b^3*c^10 - 16*a^2*b^5*c^8 + 76*a^2*b^7*c^6 - a^3*b^3*c^9 - 104*a^3*b^5*c 
^7 + 12*a^3*b^7*c^5 - 56*a^4*b^3*c^8 - 60*a^4*b^5*c^6 + 48*a^5*b^3*c^7))/c 
^8 - (((2048*(12*a*b^5*c^11 - 16*a*b^3*c^13 + 64*a^2*b*c^14 + 80*a^3*b*...